import App from "./core/App";
import Tabx from "./basic/interfaces/Tabx";
import UITabItem from "./controls/UITabItem";
import * as Types from "../types";

import "./assets/styles";
import "./assets/icons";

export default (function tabx(): Tabx {
    const tabx = <Tabx>function (options: any): void { };

    const app = new App(tabx);
    tabx.v = app.version;
    tabx.items = app.items;
    tabx.item = app.item;
    tabx.lastItem = app.lastItem;

    tabx.open = function (options: Types.TabOption) {
        app.open(options);
    }

    tabx.getItem = function (id): UITabItem | null {
        return app.getItem(id);
    }
    return tabx;
})();